At 11:27 +0300 on 28/06/1999, Christian Rudow wrote:
> I just seem to use the UPDATE not correctly, it cannot be parsed.
> What is the correct solution to this ?
> Can anyone help ?
>
> I know that's a RTFM but I have no FM to R.
> Is there a good SQL tutorial/reference accessible over the net ?
The usual FM is recommended. That is, the PostgreSQL user guide, which
comes with the software, if you compile it from source. Can't guarantee
that it comes with rpms. You can also man (postgres comes with manpages).
And you can also do a "\h update" in psql, to get the bare-bones syntax.
>From the manpage:
SYNOPSIS update classname set attname-1 = expression-1 [, attname-i = expression-i] [from from-list]
[where qual]
So, it appears that the correct syntax in Postgres would be:
UPDATE b
SET b.a_id = a.aid
FROM a
WHERE b.custno = a.custno;
Herouth
--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma